<script>
	import utils from "common/util.js"
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
			//打开webSocket
			var routes = getCurrentPages()
			console.log(routes[routes.length -1].route) 
			if(routes[routes.length -1].route != "pages/pk/pk"){
				utils.closeSocket()
				setTimeout(function(){
					utils.connectSocketInit()
				},500)
			}else{
				console.log("蛋蛋的")
			}
		},
		onHide: function() {
			var routes = getCurrentPages()
			console.log(routes[routes.length -1].route) 
			if(routes[routes.length -1].route != "pages/pk/pk"){
				utils.closeSocket()
				console.log('App Hide')
			}else{
				console.log("蛋蛋的")
			}
			
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import url("./static/css/iconfont.css");
	
	.iconfont {
		display: inline-block;
	}
</style>
